home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CUCD / Programming / OUI / include / locale.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  1.3 KB  |  53 lines

  1. // $Id: locale.h 1.2 1997/07/14 04:24:43 dlorre Exp dlorre $
  2. #ifndef CLASS_LOCALE_H
  3. #define CLASS_LOCALE_H 1
  4.  
  5. #include <exec/types.h>
  6. #include <libraries/locale.h>
  7.  
  8.  
  9. #ifdef LOCALISE
  10. #define NPARMS(a, b, c, d) (a, b, c, d)
  11. #define LPARMS(a, b, c) (a, b, c)
  12. #define OPARMS(a, b, c) (a, b, "MSG_UNDEF", c)
  13. #define DPARMS(a, b) (a, b, "MSG_UNDEF")
  14. #else
  15. #define NPARMS(a, b, c, d) (a, b, d)
  16. #define LPARMS(a, b, c) (a, b)
  17. #define OPARMS(a, b, c) (a, b, c)
  18. #define DPARMS(a, b) (a, b)
  19. #endif
  20.  
  21. class catalog
  22. {
  23. friend class lstring ;
  24.     Catalog *cat ;
  25.     int locnum ;
  26. public:
  27. #if defined( LOCALISE )
  28.     char catname[80] ;
  29.     char langname[80] ;
  30. #endif
  31.     catalog(char *name, char *deflang, char *lang) ;
  32.     ~catalog() ;
  33. } ;
  34.  
  35. class lstring               // Classe de l'application
  36. {
  37. friend class catalog ;
  38. public:
  39.     char *string ;
  40. #ifdef LOCALISE
  41.     lstring(catalog *lc, char *def, char *desc, int id=-1) ;
  42. #else
  43.     lstring(catalog *lc, char *def, int id=-1) ;
  44. #endif
  45.     // Implicit conversion
  46.     operator const char *() const { return (const char *)string ; }
  47.     operator const UBYTE *() const { return (const UBYTE *)string ; }
  48.  
  49.     // Explicit conversion (used with system functions not declaring const)
  50.     char* charptr() const { return string ; }
  51.     UBYTE* ubyteptr() const { return (UBYTE *)string ; }
  52. } ;
  53. #endif